home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / rsxwdk2s.zip / RSXWDK / LIBSRC / DOS / DOS44.C < prev    next >
C/C++ Source or Header  |  1994-12-17  |  327b  |  21 lines

  1. #include <errno.h>
  2. #include <sys/doscalls.h>
  3.  
  4.  
  5. int dos_ioctl(int handle, int code)
  6. {
  7.     struct REGPACK r;
  8.  
  9.     r.eax = 0x4400 | (code & 0xFF);
  10.     r.ebx = handle;
  11.  
  12.     _intr(0x21, &r);
  13.  
  14.     if (r.eflags & 1) {
  15.     _sys_doserror2errno( r.eax & 0xFFFF);
  16.     return (-1);
  17.     }
  18.     else
  19.     return (r.edx & 0xFFFF);
  20. }
  21.